layui.define(['jquery','scrollReveal','rate'], function (exports) {
	var moduleName = 'vip';
	var $ = layui.jquery;
	// layui.link('./js/plugins/slick.css');
	// layui.link('./js/plugins/slick-theme.css');
	// layui.link('./js/plugins/viewer.min.css')
	
	var rate = layui.rate;
	var scrollReveal = layui.scrollReveal;
	var animate = new scrollReveal({ reset: false, move: '100px'});
	var $doc = $(document);
	
	// 顶部搜索
	$doc.on('focus','.search-input',function(){
		var val = $(this).val();
		if(!val) $('.search-tips').hide();
	}).on('blur','.search-input',function(){
		var val = $(this).val();
		if(!val) $('.search-tips').show();
	})
	

	// 评分
	$('.rate').each((idx, item) => {
		var val = $(item).data('rate');
		rate.render({
			elem: item,
			value: val,
			readonly: true,
			theme: '#de606d'
		})
	})
	// 返回顶部
	$doc.on('click','.back-top',function(){
		$('html').animate({
			scrollTop:0
		},300)
	})
	
	
	exports(moduleName)
})